package com.dhnsoft.boot;

import com.dhnsoft.boot.bean.Cat;
import com.dhnsoft.boot.bean.Dog;
import com.dhnsoft.boot.bean.Pig;
import com.dhnsoft.boot.bean.Sheep;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Boot302DemoApplication {

    public static void main(String[] args) {
        var ioc = SpringApplication.run(Boot302DemoApplication.class, args);
//        for (String beanDefinitionName : ioc.getBeanDefinitionNames()) {
//            System.out.println(beanDefinitionName);
//        }

//        for (String s : ioc.getBeanNamesForType(Dog.class)) {
//            System.out.println("dog: "+s);
//        }
//
//        for (String s : ioc.getBeanNamesForType(Cat.class)) {
//            System.out.println("cat: "+s);
//        }

        Pig pig = ioc.getBean(Pig.class);
        System.out.println(pig);

        Sheep sheep = ioc.getBean(Sheep.class);
        System.out.println(sheep);
    }

}
